package createThread.cn.tedu.threaddemo.test7;

import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) throws InterruptedException {
        Object lock = new Object();
        Thread t1 = new Thread(()->{
            synchronized (lock){
                System.out.println("wait使用之前");
                try {
                    lock.wait();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("wait使用之后");
            }
        });
        t1.start();
    }
}
